package com.dreamwhale.accelerator.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dreamwhale.accelerator.entity.AlAgentRule;
import com.dreamwhale.accelerator.entity.AlUser;
import com.dreamwhale.accelerator.entity.AlVip;
import com.dreamwhale.accelerator.mapper.AlAgentRuleMapper;
import com.dreamwhale.accelerator.mapper.AlUserMapper;
import com.dreamwhale.accelerator.mapper.AlVipMapper;
import com.dreamwhale.accelerator.service.AlUserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

/**
 * <p>
 * 用户表 服务实现类
 * </p>
 *
 * @author Author
 * @since 2020-08-07
 */
@Service
public class AlUserServiceImpl extends ServiceImpl<AlUserMapper, AlUser> implements AlUserService {

    @Resource
    private AlUserMapper alUserMapper;

    @Resource
    private AlVipMapper alVipMapper;

    @Resource
    private AlAgentRuleMapper alAgentRuleMapper;

    @Override
    public AlUser selectAlUserInfo(String userId) {
        //查询会员信息
        AlUser alUser=alUserMapper.selectYxUserTime(userId);

            if (alUser.getUserVipLeve() == null) {
                alUser.setUvYearVip(-1);
            }
            if(alUser.getUarName()==null){
                alUser.setUarName("无");
            }
        return alUser;
    }
}
